/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MODEL;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ahmed
 */
@Entity
@Table(name = "CLIENT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Client.findAll", query = "SELECT c FROM Client c"),
    @NamedQuery(name = "Client.findByIdC", query = "SELECT c FROM Client c WHERE c.idC = :idC"),
    @NamedQuery(name = "Client.findByNumCompte", query = "SELECT c FROM Client c WHERE c.numCompte = :numCompte"),
    @NamedQuery(name = "Client.findByBanque", query = "SELECT c FROM Client c WHERE c.banque = :banque"),
    @NamedQuery(name = "Client.findByLogin", query = "SELECT c FROM Client c WHERE c.login = :login"),
    @NamedQuery(name = "Client.findByPassWord", query = "SELECT c FROM Client c WHERE c.passWord = :passWord"),
    @NamedQuery(name = "Client.findByNomC", query = "SELECT c FROM Client c WHERE c.nomC = :nomC"),
    @NamedQuery(name = "Client.findByPrenomC", query = "SELECT c FROM Client c WHERE c.prenomC = :prenomC"),
    @NamedQuery(name = "Client.findByAdresseC", query = "SELECT c FROM Client c WHERE c.adresseC = :adresseC")})
public class Client implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_C")
    @GeneratedValue(strategy= GenerationType.AUTO)
    private String idC;
    @Basic(optional = false)
    @Column(name = "NUM_COMPTE")
    private String numCompte;
    @Basic(optional = false)
    @Column(name = "BANQUE")
    private String banque;
    @Basic(optional = false)
    @Column(name = "LOGIN")
    private String login;
    @Basic(optional = false)
    @Column(name = "PASS_WORD")
    private String passWord;
    @Column(name = "NOM_C")
    private String nomC;
    @Column(name = "PRENOM_C")
    private String prenomC;
    @Column(name = "ADRESSE_C")
    private String adresseC;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "client")
    private Collection<Acheter> acheterCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "client")
    private Collection<Reserver2> reserver2Collection;

    public Client() {
    }

    public Client(String idC) {
        this.idC = idC;
    }

    public Client(String idC, String numCompte, String banque, String login, String passWord) {
        this.idC = idC;
        this.numCompte = numCompte;
        this.banque = banque;
        this.login = login;
        this.passWord = passWord;
    }

    public String getIdC() {
        return idC;
    }

    public void setIdC(String idC) {
        this.idC = idC;
    }

    public String getNumCompte() {
        return numCompte;
    }

    public void setNumCompte(String numCompte) {
        this.numCompte = numCompte;
    }

    public String getBanque() {
        return banque;
    }

    public void setBanque(String banque) {
        this.banque = banque;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getNomC() {
        return nomC;
    }

    public void setNomC(String nomC) {
        this.nomC = nomC;
    }

    public String getPrenomC() {
        return prenomC;
    }

    public void setPrenomC(String prenomC) {
        this.prenomC = prenomC;
    }

    public String getAdresseC() {
        return adresseC;
    }

    public void setAdresseC(String adresseC) {
        this.adresseC = adresseC;
    }

    @XmlTransient
    public Collection<Acheter> getAcheterCollection() {
        return acheterCollection;
    }

    public void setAcheterCollection(Collection<Acheter> acheterCollection) {
        this.acheterCollection = acheterCollection;
    }

    @XmlTransient
    public Collection<Reserver2> getReserver2Collection() {
        return reserver2Collection;
    }

    public void setReserver2Collection(Collection<Reserver2> reserver2Collection) {
        this.reserver2Collection = reserver2Collection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idC != null ? idC.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Client)) {
            return false;
        }
        Client other = (Client) object;
        if ((this.idC == null && other.idC != null) || (this.idC != null && !this.idC.equals(other.idC))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "MODEL.Client[ idC=" + idC + " ]";
    }
    
}
